From 4217b92e0e5b3b6f05bbc6e272646d3447531b0b Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 26 Jul 2011 15:10:57 +0000 Subject: [PATCH] * (bug 29748) Add API search prefix support Patch by TheDJ --- RELEASE-NOTES-1.19 | 1 + includes/api/ApiQuerySearch.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 3331752bca..a153d7c132 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -28,6 +28,7 @@ production. === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. +* (bug 29748) Add API search prefix support === Languages updated in 1.19 === diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index f7d9954c2d..47dc200298 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -69,6 +69,9 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $search->setNamespaces( $params['namespace'] ); $search->showRedirects = $params['redirects']; + $query = $search->transformSearchTerm( $query ); + $query = $search->replacePrefixes( $query ); + // Perform the actual search if ( $what == 'text' ) { $matches = $search->searchText( $query ); -- 2.20.1